
<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>增加</title>
    <link href="/static/devtools30/layui/css/layui.css" rel="stylesheet" />
    <link href="/static/devtools30/css/devindexbase.css" rel="stylesheet" />
    <script src="/static/devtools30/js/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="/static/devtools30/layui/layui.all.js" type="text/javascript"></script>
    <script src="/static/devtools30/js/devtoolCommon.js" type="text/javascript"></script>
    <style>
        /*页面内边距*/
        .addwrap {
            padding: 30px;
        }
        /*按钮组边框*/
        .layui-btn-primary {
            border: 1px solid #C9C9C9!important;
        }
        /*输入框高度*/
        .addwrap .layui-input,
        .layui-select {
            height: 25px;
        }

        .addwrap .layui-input-block {
            min-height: 26px;
            margin-left: 30px;
        }

        .addwrap .layui-form-label {
            padding: 0;
            text-align: left;
            height: 26px;
            line-height: 26px;
            width: auto;
        }
    </style>
</head>
<body>
<div class="backgroundf addwrap">

    <div class="layui-form" lay-filter="form">
        <input type="hidden" name="id" id ="id" th:value="${data.id}"/>

        <div class="layui-form-item">
            <label class="layui-form-label">序号</label>
            <div class="layui-input-block">
                <input  id="xh" name="xh" th:value="${data.xh}" type="number" onkeydown="DigitInput(this)"   required  lay-verify="required" placeholder="" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">名称</label>
            <div class="layui-input-block">
                <input type="text" id="flmc" name="name" th:value="${data.name}" lay-verify="required" lay-reqtext="分类名称不能为空" placeholder="请输入名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item ">
            <!--<div class="marginbottom10">备注</div>-->
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block" >
                <textarea name="sm" id="sm" placeholder="请输入备注" class="layui-textarea">[(${data.sm})]</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class=" flex flex-jusity-around tjbtn">
                <button class="layui-btn layui-btn-radius layui-btn-sm layui-btn-primary" onclick="closeWin()">取消</button>
                <button class="layui-btn layui-btn-radius layui-btn-sm " lay-submit="" lay-filter="save">保存</button>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    /*表单初始化*/
    $(function(){
        initEvent();
    });
    function closeWin(){
        dlCommon.closeParentLayer();
    }
    function initEvent(){
        layui.form.on('submit(save)', function(data){
            saveData();
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    }
    function saveData(){
        var data = layui.form.val('form');
        dlCommon.post("/DevtExcelTypeController/save",data,function(res){
            if(!res.success){
                dlCommon.layerError(res.msg);
                return;
            }
            dlCommon.layerSuccess("保存成功",function(){
                parent.loadData();
                closeWin();
            })
        })
    }

</script>
</html>

